const router = require("koa-router")()
const MovieModel = require("../../models/movie")
router.get("/api/moiveDetail",async ctx=>{
    var {id} = ctx.query
    let tables = ["top250","inTheaters","comingSoon"]
    let details = []
    for(let item of tables){
        let res = await MovieModel(item).find({_id:id})
        details.push(...res)
    }
    ctx.body={
        code:200,
        details,
        total:details.length,
        msg:"电影详情"
    }
})
module.exports = router